2 // DPNSStringHOMSupport.m
3 // HigherOrderMessaging
5 // Created by Ofri Wolfus on 26/07/07.
6 // Copyright 2007 Ofri Wolfus. All rights reserved.
9 #import "DPNSStringHOMSupport.h"
10 #import "DPCollectionEnumeration.h"
13 @implementation DPNSStringHOMSupport
15 - (BOOL)testStringWithFormat {
16 NSArray *arr = [NSArray arrayWithObjects:@"1", @"2", @"3", nil];
17 NSArray *results = [NSArray arrayWithObjects:@"1 a1", @"1 a2", @"1 a3", nil];
18 NSArray *strings = [NSString collect:MSG(stringWithFormat:@"%d a%@", 1, [arr each])];
19 return [strings isEqualToArray:results];
22 - (BOOL)testAppendFormat {
23 NSMutableString *str = [NSMutableString string];
24 NSArray *arr = [NSArray arrayWithObjects:@"1", @"2", @"3", nil];
25 [str receive:MSG(appendFormat:@"%@,", [arr each])];
26 return [str isEqualToString:@"1,2,3,"];